﻿

using System.ComponentModel;

public enum SitePage
{
    [Description("Головна")]
    Main = 1,
    [Description("Новини")]
    News = 2,
    [Description("Законодавство")]
    LowArticle = 3,
    [Description("Послуги")]
    Services = 4,
    [Description("Консультації")]
    Advice = 5,
    [Description("Про нас")]
    AboutUs = 6,
    [Description("Адміністрування")]
    AdminPage = 7
}

public class PageLink
{
    public SitePage Page { get; set; }
    public string ItemName { get; set; }
    public string PagePath { get; set; }
    public string View { get; set; }

    public string Url
    {
        get
        {
            return string.IsNullOrEmpty(View)
                ? PagePath
                : string.Format("{0}?view={1}", PagePath, View);
        }
    }

    public PageLink(SitePage page, string itemName, string pagePath, string view = null)
    {
        Page = page;
        ItemName = itemName;
        PagePath = pagePath;
        View = view;
    }
}